import request from '@/util/request'

export function fetchTypes() {
  return request({
    url: '/types',
    method: 'get'
  })
}

export function createType(data) {
  return request({
    url: '/types',
    method: 'post',
    data
  })
}

export function updateType(id, data) {
  return request({
    url: `/types/${id}`,
    method: 'put',
    data
  })
}

export function removeType(id) {
  return request({
    url: `/types/${id}`,
    method: 'delete'
  })
}
